package com.hospitalmanagementsystem.repository;

import com.hospitalmanagementsystem.entity.Appointment;
import com.hospitalmanagementsystem.entity.Department;
import com.hospitalmanagementsystem.entity.Doctor;
import com.hospitalmanagementsystem.entity.User;
import com.hospitalmanagementsystem.enums.AppointmentStatus;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.time.LocalDate;
import java.util.List;

@Repository
public interface AppointmentRepository extends JpaRepository<Appointment, Long> {
    List<Appointment> findByPatient(User patient);
    List<Appointment> findByDoctor(Doctor doctor);
    List<Appointment> findByDepartment(Department department);
    List<Appointment> findByStatus(AppointmentStatus status);
    List<Appointment> findByAppointmentDate(LocalDate date);
    List<Appointment> findByAppointmentDateBetween(LocalDate startDate, LocalDate endDate);
    List<Appointment> findByDoctorAndAppointmentDate(Doctor doctor, LocalDate date);
} 